package cn.jiyun.service.fegin;

import cn.jiyun.entity.ResultClass;
import cn.jiyun.entity.day11.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@FeignClient("day11-testpaper")
public interface TestPaperFeginService {
    //返回最新的四个试卷
    @GetMapping("/testpaper/findNewFourTestPaper")
    List<TestPaperVO> findNewFourTestPaper();
/*
 * @description:
 * @author: sjt
 * @date: 2023/8/31 11:12
 * @param: [arr]
 * @return: java.util.List<cn.jiyun.entity.day11.TestPaper>
 * @annotate:根据id集合/查询试卷信息
**/
    @PostMapping("/testpaper/findContestTestPaperList")
    List<TestPaper> findContestTestPaperList(@RequestBody List<Integer> arr);
/*
 * @description:
 * @author: sjt
 * @date: 2023/8/31 11:12
 * @param: [pid]
 * @return: java.util.List<java.lang.Integer>
 * @annotate:根据试卷id/返回此试卷的所有试题id
**/
    @GetMapping("/testpaper/findTestPaperTopicIds")
    List<Integer> findTestPaperTopicIds(@RequestParam("pid") Integer pid);
//根据id查询一个试卷的信息
    @GetMapping("/testpaper/selectOne")
    TestPaper selectOne(@RequestParam("pid") Integer pid);
//查询试卷完成的个数
    @GetMapping("/testpaper/selectTestPaperOverNum")
    Integer selectTestPaperOverNum(@RequestParam("pid") Integer pid);
//分页查询试卷集合
    @PostMapping("/testpaper/findTestPaperList")
    List<TestPaperVO> findTestPaperList(@RequestBody TestPaperDTO dto);

    //根据试卷id返回试题个数
    @GetMapping("/testpaper/findTestPaperTopicNum")
    Integer findTestPaperTopicNum(@RequestParam("pid") Integer pid);
//提交模拟考试记录
    @PostMapping("/testpaper/setUserTestPaperOver")
    Integer setUserTestPaperOver(@RequestBody UserTestPaperOver over);
//查询历史提交次数
    @GetMapping("/testpaper/findUserHistoryDetectionCount")
    Integer findUserHistoryDetectionCount(@RequestParam("uid") Integer uid);
//提交答案
    @PostMapping("/testpaper/addTestPaperOverAnswers")
    Integer addTestPaperOverAnswers(@RequestParam("oid") Integer oid,@RequestBody Map<Integer,String> map);

    //查询当前登录人的历史测验信息
    @PostMapping("/testpaper/selectLoginUserTestPaperOverList")
    ResultClass selectLoginUserTestPaperOverList(@RequestBody TestPaperDTO dto,@RequestParam("uid") Integer uid);

    @GetMapping("/testpaper/findhistoryTestPaperAnswer")
    List<TestpaperOverAnswer> findhistoryTestPaperAnswer(@RequestParam("id") Integer id);

    @GetMapping("/testpaper/selecttestpaper")
    TestPaper selecttestpaper(@RequestParam("pid") Integer pid);
}
